package net.chasing.retrofit.engine;

import net.chasing.retrofit.RetrofitManager;
import net.chasing.retrofit.api.ApiV1Service;
import net.chasing.retrofit.bean.base.NoParameterReq;
import net.chasing.retrofit.bean.base.RequestHeader;
import net.chasing.retrofit.bean.base.ResponseResult;
import net.chasing.retrofit.callback.AbstractResponseCallback;
import net.chasing.retrofit.util.RxUtil;

import io.reactivex.rxjava3.core.Flowable;
import io.reactivex.rxjava3.subscribers.ResourceSubscriber;

public class ApiV1Engine {
    private final ApiV1Service mService;

    public ApiV1Engine(){
        mService = RetrofitManager.getInstance().createRetrofitService(ApiV1Service.class);
    }

    public ResourceSubscriber<?> smscode(Object req, AbstractResponseCallback<Object> callback) {
        Flowable<ResponseResult<Object>> flowable = mService.smscode(req);
        return RxUtil.toSubscribe(flowable, callback);
    }

}
